﻿// -----------------------------------------------------------------------
// <copyright file="GenderSelector.cs" company="Hewlett-Packard">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex3.FriendSelector
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class GenderStrategy : IStrategy
    {
        private bool m_IsFemale;

        public GenderStrategy(bool i_IsFemale)
        {
            this.m_IsFemale = i_IsFemale;
        }

        public bool IsFriendWanted(FacebookWrapper.ObjectModel.User i_friend)
        {
            if (i_friend.Gender != null)
            {
                if (m_IsFemale)
                {
                    return i_friend.Gender.Value == FacebookWrapper.ObjectModel.User.eGender.female;
                }
                else
                {
                    return i_friend.Gender.Value == FacebookWrapper.ObjectModel.User.eGender.male;
                }
            }
            else
            {
                return false;
            }
        }
    }
}
